package com.grom.velocity;

import com.grom.constant.FileUtil;
import com.grom.xml.XmlParser;

import java.io.*;

public class DaoCreator extends AbstractCreator {
	private XmlParser parser = null;

	public DaoCreator(XmlParser parser) {
		this.parser = parser;
	}

	public File getTargetFile(String templateFile) {
		if (templateFile.indexOf("mpl") > 0) {
			return new File(FileUtil.getCurrentProjectAbsolutePath() + "/src/com/grom/dao/" + parser.getClassName()
					+ "Dao.java");
		} else {
			return new File(FileUtil.getCurrentProjectAbsolutePath() + "/src/com/grom/dao/" + parser.getClassName()
					+ "DaoImpl.java");
		}
	}
}
